//
//  HRSignListCell.m
//  Hear
//
//  Created by mac on 2018/3/6.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "HRSignListCell.h"
#import "UIButton+SSEdgeInsets.h"
@interface HRSignListCell ()
@property (nonatomic,strong)UILabel *showTextLabel;
@property (nonatomic,strong)UIButton *showGoldButton;
@property (nonatomic,strong)UIImageView *rightImageView;

@end
@implementation HRSignListCell

-(void)setSignModel:(HRSignInModel *)signModel{
    self.showTextLabel.text = [NSString stringWithFormat:@"%@ %@",signModel.content,signModel.completion];
    [self.showGoldButton setTitle:[NSString stringWithFormat:@"+%@",signModel.coins] forState:0];
    [self.showGoldButton setImagePositionWithType:SSImagePositionTypeRight spacing:3];

}

+(instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"HRSignListCell";
    
    HRSignListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if(!cell){
        cell = [[HRSignListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    if (self)
    {
        CGFloat cellHeight = 50;
        
        self.showTextLabel = [[UILabel alloc] initWithFrame:CGRectMake(25, 0, kScreenWidth-120, cellHeight)];
//        self.showTextLabel.text = @"评价他人动态 0/1";
        self.showTextLabel.textColor = SecondTextColor;
        self.showTextLabel.font = CustomUIFont(14);
        [self addSubview:self.showTextLabel];
        
        self.showGoldButton = [[UIButton alloc] initWithFrame:CGRectMake(self.showTextLabel.right+20, 15, 50, 20)];
        [self.showGoldButton setImage:[UIImage imageNamed:@"乐币"] forState:0];
//        [self.showGoldButton setTitle:@"+1" forState:0];
        [self.showGoldButton setTitleColor:[UIColor orangeColor] forState:0];
        self.showGoldButton.titleLabel.font = CustomUIFont(14);
        [self addSubview:self.showGoldButton];
        
        self.rightImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.showGoldButton.right, 20, 9, 15)];
        self.rightImageView.image = [UIImage imageNamed:@"签到_箭头"];
        [self addSubview:self.rightImageView];
        
        UILabel *lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.showTextLabel.left, cellHeight-1, kScreenWidth-self.showTextLabel.left, 1)];
        lineLabel.backgroundColor = CustomColor(240, 240, 240, 1);
        [self addSubview:lineLabel];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
